<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/OGDIMasterPage.Master"
    Inherits="System.Web.Mvc.ViewPage<Ogdi.InteractiveSdk.Mvc.Models.DataBrowserModel>" %>

<%@ Import Namespace="Ogdi.InteractiveSdk.Mvc.App_GlobalResources" %>
<%@ Import Namespace="Ogdi.InteractiveSdk.Mvc.Models" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript" language="javascript"
    src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>

    <script type="text/javascript" language="javascript" 
    src="<%= Url.Content("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js") %>"></script>
   
    <script type="text/javascript" language="javascript"
     src="<%= Url.Content("../../Scripts/DataBrowser.min.js") %>"></script>

    <script type="text/javascript" language="javascript"
     src="<%= Url.Content("../../Scripts/jquery.clipboard.min.js") %>"></script>

    <!-- If you are using IE8, then COMMENT / UNCOMMENT this meta tag
         to demonstrate working in IE7 -->
    <%--<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />--%>
    
    <script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjax.js" type="text/javascript"></script>  
    
    <script type="text/javascript">
        Sys.Application.set_enableHistory(true);
        Sys.Application.add_init(page_init);
        
        //  Constant used for storing damaged bookmark error
        var mapControlError = '<%= UIConstants.DBPC_mapControlError %>';
        
        // Separator used for separating bookmarking parameters in URL Hash
        var hashSeparator = '<%= UIConstants.DBPC_hashSeparator %>';
        
        var map;
        var kmlLayer;
        var mapLoaded = false;
        var kmlQuery;
        var ExpanderImage = '<%= UIConstants.GC_ExpandImagePath %>';
        var ExpanderImageDescription = '<%= UIConstants.GC_ExpandImageLongDesc %>';
        var CollapserImage = '<%= UIConstants.GC_CollapseImagePath %>';
        var RunLogoImage = '<%= UIConstants.DBPC_RunLogoImage %>';
        var HelpLogoImage = '<%= UIConstants.DBPC_HelpLogoImage %>';
        var RunLogoImageAlternateText = '<%= UIConstants.DBPC_RunLogoImageAlternateText %>';
        var HelpLogoImageAlternateText = '<%= UIConstants.DBPC_HelpLogoImageAlternateText %>';
        var MapViewNote = '<%= UIConstants.DBPC_MapViewNote %>';
        var MapViewNoteLink = '<%= UIConstants.DBPC_MapViewNoteLink %>';
        var MapViewNoteLinkText = '<%= UIConstants.DBPC_MapViewNoteLinkText %>';
        var container = '<%= Html.Encode(ViewData.Model.Container) %>';
        var entitySet = '<%= Html.Encode(ViewData.Model.EntitySetName) %>';
        var mainFilter = '';
        var defaultFilterText = '<%= UIConstants.DBPC_DefaultFilterText %>';
        var defaultSelectOneText = '<%= UIConstants.DBPC_SelectOneText %>';

        var scheme = '<%= HttpContext.Current.Request.Url.Scheme %>';
        var host = '<%= HttpContext.Current.Request.Url.Host %>';
        var port = '<%= HttpContext.Current.Request.Url.Port %>';
        var appPath = '<%= HttpContext.Current.Request.ApplicationPath %>';
        var isBookmarked = '<%= ViewData.Model.IsBookmarked %>';
        var viewType = '';
        var tagType = '';
        var sampleCodeLanguage = '';       
        var longitude = 0;
        var latitude = 0;
        var zoomLevel = 11;
        var mapMode = 1;
        var mapStyle;
        var sceneId = 0;
        var birdseyeSceneOrientation = 0;
        var isSelectOne = '<%= ViewData.Model.IsSelectOne %>';        
        var noFilterText = '<%= UIConstants.DBPC_NoFilterText %>';
        var isFilterChanged = false;
        var clientSideError = '<%= UIConstants.GC_BadRequestErrorString %>';
        var noRunClickedError = '<%= UIConstants.GC_NoRunClickedError %>';
        var horizontalAxisColText = '<%= UIConstants.DBPC_HorizontalAxisColumnText %>';
        var tooLongURLtoBookmark = '<%= UIConstants.DBPC_TooLongURLForBookmark %>';
        var filterRunned = noFilterText;
        var siteTitle = '<%= UIConstants.SiteTitle %>';
    </script>
    <div id="dataBrowserPageDiv">
        <iframe id="__historyFrame" src="<%= Url.Action("Index", "HistoryIframeHelper") %>"
             style="display:none;"></iframe>
         
        <div id="BackGroundLoadingIndicator" class="bgLoadingIndicator"
         style="display: none">
        </div>
        <div id="LoadingIndicatorPanel"  style="display: none; position:  ">
            <img id="imgLoading" class="loader" 
                alt='<%= UIConstants.GC_LoadingAltText %>'
                style="display: none"
                src='<%=UIConstants.GC_LoadingImagePath %>'
                longdesc='<%= UIConstants.GC_LoadingLongDesc %>'
                onload="showLoadingIndicator();" />
        </div>
        <h1>
            Data Browser</h1>
        <div>
            <div id="Para1" style="cursor: hand" 
            title="Click for more details..." class="collapsePanelHeader">
                <p class="big">
                    <%= UIConstants.DBPC_DataBrowserIntro1 %><img 
                        id="ExpandCollapseImage" 
                        alt='<%= UIConstants.GC_ExpandCollapseImageAltText %>'
                        src='<%= UIConstants.GC_ExpandImagePath %>' 
                        title="Show Details" 
                        longdesc='<%= UIConstants.GC_ExpandImageLongDesc %>' />
                </p>
            </div>
            <div id="Para2" style="margin: 0px; padding-top: 0px; 
                display: none; padding-bottom: 15px;">
                <p class="big" style="padding-top: 0px; margin: 0px">
                    <%= UIConstants.DBPC_DataBrowserIntro2 %>
                </p>
            </div>
        </div>
        <div id="divError" style="display: none">
            <% Html.RenderPartial("ErrorView", ViewData); %>
        </div>
    </div>
    <table>
        <tbody>
            <tr>
                <td class="leftcolumn">
                    <b>Entity Set</b>:
                </td>
                <td class="style6">
                    <span class="maintext">
                        <%=ViewData.Model.EntitySetName%>
                    </span>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td class="leftcolumn">
                    <b>Base Query</b>:
                </td>
                <td class="style6">
                    <span class="maintext">
                        <%=ViewData.Model.BaseQueryName %>
                        <label id="labelBaseQuery" 
                            title="<%= ViewData.Model.BaseQueryName %>" visible="false">
                        </label>
                    </span>
                </td>
                <td valign="bottom">
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top;" class="leftcolumn">
                    <b style="vertical-align: top">Filter Expression:</b>
                    <div style="float: right; vertical-align: top">
                        <a onclick="javascript:ShowFilterHintsDialog()">
                            <img class="filterhints" 
                                src='<%= UIConstants.DBPC_HelpImagePath %>' 
                                alt='<%= UIConstants.DBPC_HelpImageAltText %>'
                                longdesc='<%= UIConstants.DBPC_HelpImageLongDesc %>'
                                title="Show Filter Hints" />
                        </a>
                    </div>
                    <br />
                    <b style="vertical-align: top">($filter) </b>&nbsp;&nbsp;<br />
                    <br />
                </td>
                <td style="vertical-align: bottom" class="middlecolumn">
                    <textarea id="queryBox" rows="2" cols="20" 
                        style="font-style: italic;" class="nice" onchange="filterChanged()"
                        onfocus="onFocus()"
                        onblur="onBlur()"><%=  ViewData.Model.FilterText %></textarea>
                </td>
                <td valign="top">
                    <a href="javascript:runClicked()">
                        <img alt='<%= UIConstants.DBPC_RunAltText %>'
                            src='<%= UIConstants.DBPC_RunImagePath %>'
                            title='<%= UIConstants.DBPC_RunLogoTitle %>' 
                            longdesc='<%= UIConstants.DBPC_RunLongDesc %>'
                            style="width: 80px;" />
                    </a>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top;" class="leftcolumn">
                    &nbsp;
                </td>
                <td style="vertical-align: bottom" class="middlecolumn">
                    &nbsp;
                </td>
                <td valign="bottom">
                    &nbsp;
                </td>
            </tr>
        </tbody>
    </table>
   
    <div id="tabs" style="visibility: hidden;">
        <ul>
            <li id="liDataView"><a href="#tabs-1">Data View</a></li>
            <li id="liMapView"><a href="#tabs-2">Map View</a></li>
            <li id="liBarChart"><a href="#tabs-3">Bar Chart</a></li>
            <li id="liPieChart"><a href="#tabs-4">Pie Chart</a></li>
        </ul>
        <div id="tabs-1">
            <div id="dataViewAccordion">
                <h3 id="dataViewSampleCode">
                    <a href="#">Sample Code</a></h3>
                <div id="divOuterDataViewSampleCode" >
                    <div style="vertical-align: bottom;
                         margin-top: 5px; float: left;">
                        Language/Environment:&nbsp;
                        <%= Html.DropDownList("languagesDataView",
                            ViewData.Model.DataViewLanguages)%>
                    </div>
                    &nbsp;&nbsp;<img id="copyDataCodeButton" 
                        src='<%= UIConstants.DBPC_CopyDataImagePath %>'
                        class="copyicon" title="Copy to Clipboard" 
                        alt='<%= UIConstants.DBPC_CopyDataAltText %>'
                        longdesc="<%= UIConstants.DBPC_CopyDataLongDesc %>" />
                    <br />
                    <div id="divDataViewSampleCode" class="codesamplescroll">
                        <div>
                            <% Html.RenderPartial("SampleCodeDataView", ViewData); %>
                        </div>
                    </div>
                </div>
                <h3 id="dataViewResults">
                    <a href="#">Results</a></h3>
                <div id="divDataViewResults" style="overflow:scroll;">
                    <% Html.RenderPartial("DataView", ViewData); %>
                </div>
            </div>
        </div>
        <div id="tabs-2">
            <div id="mapViewAccordion">
                <h3 id="mapViewSampleCode">
                    <a href="#">Sample Code</a></h3>
                <div id="divOuterMapViewSampleCode">
                    <p>
                        NOTE: This is a working sample. You can copy / paste this code into an html file.
                        However, you must download the dependent jquery-1.4.2.min.js file for successful
                        execution. You can download jquery-1.4.2.min.js from <a 
                            href="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js">
                            here</a>.</p>
                    <div style="vertical-align: bottom; margin-top: 5px; float: left;">
                        Language/Environment:&nbsp;
                        <%= Html.DropDownList("languagesMapView", 
                            ViewData.Model.MapViewLanguages)%>
                    </div>
                    &nbsp;<img id="copyMapCodeButton" 
                        src='<%= UIConstants.DBPC_CopyDataImagePath %>'
                        class="copyicon" title="Copy to Clipboard" 
                        alt='<%= UIConstants.DBPC_CopyDataAltText %>'
                        longdesc='<%= UIConstants.DBPC_CopyDataLongDesc %>' />
                    <br />
                    <div id="divMapViewSampleCode" class="codesamplescroll">
                        <% Html.RenderPartial("SampleCodeMapView", ViewData); %>
                    </div>
                </div>
                <h3 id="mapViewResults">
                    <a href="#">Results</a></h3>
                <div id="divMapViewResults">
                    <div id="mapFullQueryPanel" style="display: none;">
                        <span>Full Query URL:</span> &nbsp;<a 
                            id="mapFullQueryUrlHyperlink" target="_blank"></a>
                        <br />
                        <div>
                            (Click to view results as XML/KML)</div>
                    </div>
                    <div id="mapNoResultsDiv" style="display: none;">
                        <span>Selected data does not have location information.</span>
                    </div>
                    <div id="mapManyPlacemarksDiv" style="display: none;">
                        <span>Number of placemarks in a result set exceeds the pin display count limit (50 placemarks)</span>
                    </div>                    
                    <br />
                    <div id='myMap' class="veMapStyle">
                    </div>
                    <br />
                </div>
            </div>
        </div>
        <div id="tabs-3">
            <div id="barChartAccordion">
                <h3 id="barChartSampleCode">
                    <a href="#">Sample Code</a></h3>
                <div id="divOuterBarChartViewSampleCode">
                    <div style="vertical-align: bottom; margin-top: 5px; float: left;">
                        Language/Environment:&nbsp;
                        <%= Html.DropDownList("languagesBarChartView",
                            ViewData.Model.BarChartViewLanguages)%>
                    </div>
                    &nbsp;<img id="copyBarChartCodeButton" 
                        src='<%= UIConstants.DBPC_CopyDataImagePath %>'
                        class="copyicon" title="Copy to Clipboard" 
                        alt='<%= UIConstants.DBPC_CopyDataAltText %>'
                        longdesc='<%= UIConstants.DBPC_CopyDataLongDesc %>' />
                    <br />
                    <div id="divBarChartViewSampleCode" class="codesamplescrollchart" style="height: 630px;">
                        <% Html.RenderPartial("SampleCodeBarChartView", ViewData); %>
                    </div>
                </div>
                <h3 id="barChartResults">
                    <a href="#">Results</a></h3>
                <div id="divOuterBarChartResults" style="height: 630px;">
                    <div>
                        <table style="width: 100%;">
                            <tr style="height: 100%;">
                                <td>
                                    <fieldset style="height: 130px; padding: 0px; 
                                        border-style: solid; border-color: #eeeeee;">
                                        <legend style="text-align: left;"><b>Horizontal Axis</b>
                                        </legend>
                                        <br />
                                        <table>
                                            <tr style="padding: 10px">
                                                <td style="text-align: left;">
                                                    <label id="labelBarHorizontalComboBox">
                                                        Entityset
                                                        <br />
                                                        Column:&nbsp;&nbsp;</label>
                                                </td>
                                                <td>
                                                    <%= Html.DropDownList("ddlBarHorizontal", 
                                                        ViewData.Model.BarHorizontal, 
                                                        new { style = "width:175px;", 
                                                            onchange = "horizontalBarComboBoxSelected(this.value)" })%>
                                                </td>
                                            </tr>
                                            <tr style="height: 10px;">
                                            </tr>
                                            <tr style="padding: 10px">
                                                <td style="text-align: left;">
                                                    <label id="labelBarDateRange" 
                                                    style="display: none;">
                                                        Date
                                                        <br />
                                                        Range:</label>
                                                </td>
                                                <td>
                                                    <%= Html.DropDownList("ddlBarDateRange",
                                                        ViewData.Model.BarDateRange,
                                                        new { style = "display:none;" })%>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                </td>
                                <td>
                                    <fieldset style="height: 130px; text-align: center; padding:
                                         0px; border-style: solid;
                                        border-color: #eeeeee;">
                                        <legend style="text-align: left;"><b>Vertical Axis</b>
                                        </legend>
                                        <table>
                                            <tr>
                                                <td style="width: 150px;">
                                                    <fieldset style="height: 100px; width: 150px; 
                                                        padding: 0px; border-style: solid;
                                                        border-color: #eeeeee;">
                                                        <legend style="text-align: left;">
                                                            <%= Html.RadioButton("BarVerticalOptions", 
                                                                "Option1", true,
                                                                new { name = "BarVerticalOptions", 
                                                                    onclick = "barOption1Selected();" })%>
                                                                    Option 1 </legend>
                                                        <table>
                                                            <tr>
                                                                <td>
                                                                    <label id="labelBarCount">
                                                                        No. of occurrences of
                                                                    </label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                                <td>
                                                    <fieldset style="height: 100px; padding: 0px; 
                                                        border-style: solid; border-color: #eeeeee;">
                                                        <legend style="text-align: left;">
                                                            <% if (ViewData.Model.BarYOption != null && 
                                                                   ViewData.Model.BarYOption == "Option2")
                                                               { %>
                                                            <%= Html.RadioButton("BarVerticalOptions", 
                                                                            "Option2", true,
                                                                            new { name = "BarVerticalOptions", 
                                                                                onclick = "barOption2Selected();" })%>
                                                                                Option 2
                                                            <% }
                                                               else
                                                               { %>
                                                            <%= Html.RadioButton("BarVerticalOptions", 
                                                                            "Option2", false,
                                                                            new { name = "BarVerticalOptions",
                                                                                onclick = "barOption2Selected();" })%>
                                                                                Option 2
                                                            <% } %>
                                                        </legend>
                                                        <div>
                                                            <table>
                                                                <tr style="padding: 10px;">
                                                                    <td style="text-align: left;">
                                                                        <label id="VerticalComboBoxLabel" 
                                                                        style="color: Gray;">
                                                                            Entityset
                                                                            <br />
                                                                            Column:&nbsp;&nbsp;</label>
                                                                    </td>
                                                                    <td>
                                                                        <%= Html.DropDownList("ddlBarVertical",
                                                                            ViewData.Model.BarVertical, 
                                                                            new { style = "width:175px;", 
                                                                                disabled = "disabled" })%>
                                                                    </td>
                                                                </tr>
                                                                <tr style="height: 10px;">
                                                                </tr>
                                                            </table>
                                                        </div>
                                                        <div>
                                                            <%= Html.RadioButton("BarVerticalColumnOptions", 
                                                                "Aggregate", true, new { disabled = "disabled" })%>
                                                            <label id="labelBarAggregate" style="color: Gray;">
                                                                Aggregate</label>
                                                            <% if (ViewData.Model.BarYColOption != null &&
                                                                   ViewData.Model.BarYColOption == "Average")
                                                               { %>
                                                            <%= Html.RadioButton("BarVerticalColumnOptions", 
                                                                "Average", true, new { disabled = "disabled" })%>
                                                            <% }
                                                               else
                                                               { %>
                                                            <%= Html.RadioButton("BarVerticalColumnOptions", 
                                                                "Average", false, new { disabled = "disabled" })%>
                                                            <% } %>
                                                            <label id="labelBarAverage" style="color: Gray;">
                                                                Average</label>
                                                        </div>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                </td>
                                <td valign="top" style="padding-top: 5px;">
                                    <a href="javascript:getBarChart()">
                                        <img alt='AltText' 
                                        src='/Images/RefreshChart.png'
                                        title='Refresh Chart' 
                                        longdesc='<%= UIConstants.DBPC_RunLongDesc %>'
                                        style="width: 185px" />
                                    </a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="divBarChartError" style="display: none; 
                        background-color: Red; color: White;
                        text-align: center; font-weight: bold; font-size: 17px;">
                        <%= UIConstants.DBPC_ChartErrorText %>
                    </div>
                    <div id="divBarChartResults">
                        <% if (ViewData.Model.Chart != null)
                           {
                               Html.RenderPartial("BarChart", ViewData);
                           } %>
                    </div>
                </div>
            </div>
        </div>
        <div id="tabs-4">
            <div id="pieChartAccordion">
                <h3 id="pieChartSampleCode">
                    <a href="#">Sample Code</a></h3>
                <div id="divOuterPieChartViewSampleCode">
                    <div style="vertical-align: bottom; margin-top: 5px; float: left;">
                        Language/Environment:&nbsp;
                        <%= Html.DropDownList("languagesPieChartView", 
                            ViewData.Model.PieChartViewLanguages)%>
                    </div>
                    &nbsp;<img id="copyPieChartCodeButton" 
                        src='<%= UIConstants.DBPC_CopyDataImagePath %>'
                        class="copyicon" title="Copy to Clipboard" 
                        alt='<%= UIConstants.DBPC_CopyDataAltText %>'
                        longdesc='<%= UIConstants.DBPC_CopyDataLongDesc %>' />
                    <br />
                    <div id="divPieChartViewSampleCode" class="codesamplescrollchart" style="height:780px;">
                        <% Html.RenderPartial("SampleCodePieChartView", ViewData); %>
                    </div>
                </div>
                <h3 id="pieChartResults">
                    <a href="#">Results</a></h3>
                <div id="divPieResultHeight">
                    <div>
                        <table style="width: 100%;">
                            <tr style="height: 100%;">
                                <td>
                                    <fieldset style="height: 130px; padding: 0px;
                                         border-style: solid; border-color: #eeeeee;">
                                        <legend style="text-align: left;"><b>Horizontal Axis</b>
                                        </legend>
                                        <br />
                                        <table>
                                            <tr style="padding: 10px">
                                                <td style="text-align: left;">
                                                    <label id="labelPieHorizontalComboBox">
                                                        Entityset
                                                        <br />
                                                        Column:&nbsp;&nbsp;</label>
                                                </td>
                                                <td>
                                                    <%= Html.DropDownList("ddlPieHorizontal", 
                                                        ViewData.Model.PieHorizontal,
                                                        new { style = "width:175px;",
                                                            onchange = "horizontalPieComboBoxSelected(this.value)" })%>
                                                </td>
                                            </tr>
                                            <tr style="height: 10px;">
                                            </tr>
                                            <tr style="padding: 10px">
                                                <td style="text-align: left;">
                                                    <label id="labelPieDateRange" style="display: none;">
                                                        Date<br />
                                                        Range:</label>
                                                </td>
                                                <td>
                                                    <%= Html.DropDownList("ddlPieDateRange", 
                                                        ViewData.Model.PieDateRange, 
                                                        new { style = "display:none;" })%>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                </td>
                                <td>
                                    <fieldset style="height: 130px; text-align: center; 
                                        padding: 0px; border-style: solid;
                                        border-color: #eeeeee;">
                                        <legend style="text-align: left;"><b>Vertical Axis</b>
                                        </legend>
                                        <table>
                                            <tr>
                                                <td style="width: 150px;">
                                                    <fieldset style="height: 100px; width: 150px; 
                                                        padding: 0px; border-style: solid;
                                                        border-color: #eeeeee;">
                                                        <legend style="text-align: left;">
                                                            <%= Html.RadioButton("PieVerticalOptions", 
                                                                "Option1", true, 
                                                                    new { name="PieVerticalOptions", 
                                                                        onclick = "pieOption1Selected();" })%>
                                                                        Option 1 </legend>
                                                        <table>
                                                            <tr>
                                                                <td>
                                                                    <label id="labelPieCount">
                                                                        No. of occurrences of
                                                                    </label>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                                <td>
                                                    <fieldset style="height: 100px; padding: 0px; 
                                                        border-style: solid; border-color: #eeeeee;">
                                                        <legend style="text-align: left;">
                                                            <% if (ViewData.Model.PieYOption != null && 
                                                                   ViewData.Model.PieYOption == "Option2")
                                                               { %>
                                                            <%= Html.RadioButton("PieVerticalOptions",
                                                                        "Option2", true, 
                                                                         new { name = "PieVerticalOptions", 
                                                                             onclick = "pieOption2Selected();" })%>
                                                                             Option 2
                                                            <% }
                                                               else
                                                               { %>
                                                            <%= Html.RadioButton("PieVerticalOptions", 
                                                                        "Option2", false, 
                                                                        new { name = "PieVerticalOptions", 
                                                                            onclick = "pieOption2Selected();" })%>
                                                                            Option 2
                                                            <% } %>
                                                        </legend>
                                                        <div>
                                                            <table>
                                                                <tr style="padding: 10px;">
                                                                    <td style="text-align: left;">
                                                                        <label id="labelPieVerticalComboBox" 
                                                                        style="color: Gray">
                                                                            Entityset
                                                                            <br />
                                                                            Column:&nbsp;&nbsp;</label>
                                                                    </td>
                                                                    <td>
                                                                        <%= Html.DropDownList("ddlPieVertical", 
                                                                            ViewData.Model.PieVertical, 
                                                                            new { style = "width:175px;", disabled = "disabled" })%>
                                                                    </td>
                                                                </tr>
                                                                <tr style="height: 10px;">
                                                                </tr>
                                                            </table>
                                                        </div>
                                                        <div>
                                                            <%= Html.RadioButton("PieVerticalColumnOptions",
                                                                "Aggregate", true, new { disabled = "disabled" })%>
                                                            <label id="labelPieAggregate" style="color: Gray">
                                                                Aggregate</label>
                                                            <% if (ViewData.Model.PieYColOption != null && 
                                                                   ViewData.Model.PieYColOption == "Average")
                                                               { %>
                                                            <%= Html.RadioButton("PieVerticalColumnOptions", 
                                                                "Average", true, new { disabled = "disabled" })%>
                                                            <% }
                                                               else
                                                               { %>
                                                            <%= Html.RadioButton("PieVerticalColumnOptions", 
                                                                "Average", false, new { disabled = "disabled" })%>
                                                            <% } %>
                                                            <label id="labelPieAverage" style="color: Gray">
                                                                Average</label>
                                                        </div>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                </td>
                                <td valign="top" style="padding-top: 5px;">
                                    <a href="javascript:getPieChart()">
                                        <img alt='AltText' 
                                        src='/Images/RefreshChart.png' 
                                        title='Refresh Chart' 
                                        longdesc='<%= UIConstants.DBPC_RunLongDesc %>'
                                        style="width: 185px" />
                                    </a>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="divPieChartError" style="display: none; 
                        background-color: Red; color: White;
                        text-align: center; font-weight: bold; font-size: 17px;">
                        <%= UIConstants.DBPC_ChartErrorText %>
                    </div>
                    <div id="divPieChartResults" style="height:849px;">
                        <% if (ViewData.Model.Chart != null)
                           {
                               Html.RenderPartial("PieChart", ViewData);
                           } %>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="filterDialog" title="$filter hints"
     class="filterdialog" style="visibility: hidden;">
        <p>
            OGDI uses a subset of the <a 
            href="http://msdn.microsoft.com/en-us/library/cc668784(VS.100).aspx">
                WCF Data Services query syntax</a><img
                src='<%= UIConstants.GC_ExternalLinkImagePath %>'
                alt='<%= UIConstants.DBPC_ADOqueryAltText %>'
                title='<%= UIConstants.DBPC_ADOqueryTitle %>'
                longdesc='<%= UIConstants.DBPC_ADOqueryLongDesc %>' />. The basic format
            of a filter expression is <i>property</i>&nbsp;<i>comparison</i>&nbsp;<i>expression</i>,
            where <i>property</i> is the name of a property, <i>comparison</i> is a comparison
            operator, and <i>expression</i> is the expression with which the property&#39;s
            value should be compared.
        </p>
        <p>
            Some examples of filter expressions using the CrimeIncidents data set from the DC
            container are:</p>
        <table width="100%">
            <tr>
                <td style="vertical-align: top">
                    method eq 2
                </td>
                <td style="vertical-align: top">
                    <p>
                        Crime incidents where the method code is equal to 2. Other comparison operators
                        include &quot;gt&quot; for greater than, &quot;lt&quot; for less than, &quot;ge&quot;
                        for greater than or equal to, and &quot;le&quot; for less than or equal to.</p>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    shift eq &#39;EVN&#39;
                </td>
                <td style="vertical-align: top">
                    <p>
                        Crime incidents where the &quot;shift&quot; property is equal to &quot;EVN&quot;.
                        String literals must be enclosed in single quotes. Boolean literals are represented
                        as &quot;true&quot; or &quot;false&quot; (without the double quotes).</p>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    reportdatetime ge datetime&#39;2008-06-01T00:00:00Z&#39;
                </td>
                <td style="vertical-align: top">
                    <p>
                        Crime incidents where the report date/time is on or after midnight, June 1, 2008,
                        UTC. Date/time literals are expressed in <a 
                        href="http://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a><img 
                        src="<%= UIConstants.GC_ExternalLinkImagePath %>"
                        alt="<%= UIConstants.DBPC_ISO8601AltText %>" 
                        title="<%= UIConstants.DBPC_ISO8601Title %>"
                        longdesc="<%= UIConstants.DBPC_ISO8601LongDesc %>" />
                        format, <i>yyyy</i>-<i>mm</i>-<i>dd</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>, where <i>yyyy</i>
                        is the four-digit year, <i>mm</i> is the two-digit month number, <i>dd</i> is the
                        two-digit day of the month, <i>HH</i> is the two-digit hour (in 24-hour format),
                        <i>MM</i> is the two-digit minute, and <i>SS</i> is the two-digit second.</p>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top">
                    (shift eq &#39;EVN&#39;) or (shift eq &#39;MID&#39;)
                </td>
                <td style="vertical-align: top">
                    <p>
                        Crime incidents where the shift is equal to &quot;EVN;&quot; or &quot;MID&quot;.
                        The filter syntax supports the &quot;and&quot;, &quot;or&quot;, and &quot;not&quot;
                        logical operators. Expressions can grouped with parentheses, as in many popular
                        programming languages.</p>
                </td>
            </tr>
        </table>
    </div>
    <div>
        <p>

            <script type="text/javascript">
                var addthis_pub = '<%=  UIConstants.BMC_AddThisPubKey %>';
            </script>

            <label id="lblURL" visible="false">
            </label>
            <a href="<%= UIConstants.BMC_BookmarkPath %>" 
                onclick="return addthis_sendto()" 
                onmouseout="addthis_close()"
                onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')">
                <img alt="<%= UIConstants.BMC_ImageAltText %>" 
                height="16" src="<%= UIConstants.BMC_ImagePath %>"
                style="border: 0" width="125" title="<%= UIConstants.BMC_BookmarkTitle %>" 
                longdesc="<%= UIConstants.BMC_LongDescPath %>" />
            </a>

            <script type="text/javascript" 
            src="http://s7.addthis.com/js/200/addthis_widget.js">
            </script>

        </p>
    </div>    
</asp:Content>
